<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <base href="<%=basePath%>"/>
    <title>修改客户资料</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=7" />
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>
	<style type="text/css">
		#upCusForm label.error{font-size:12px;color:red;}
		</style>
		
    <link id="editCss" rel="stylesheet" type="text/css" href="<%=path %>/css/style.css" />
    <link id="editCss" rel="stylesheet" type="text/css" href="<%=path%>/css/right.css" />
   	<script src="<%=path%>/js/jquery.js" type="text/javascript"></script>
		<script src="<%=path%>/js/jquery.validate.js" type="text/javascript"></script>
 
    
  <!-- validate begin  -->
	<script type="text/javascript">
	  $( jQuery.validator.addMethod("zip", function(value, element) { var tel = /^[0-9]{6}$/;  return this.optional(element) || (tel.test(value)); }, "请正确填写邮政编码"));
	
    $(
         function(){
               $('#upCusForm').validate({
             rules:{ contactName: {
                                        required:true,
                                        minlength:3,
                                        maxlength:30,
                                        onkeyup:false
                          },contactPhone:{
                                required:true,
                                minlength:7,
                                maxlength:12,
                                onkeyup:false
                          }, postCode:{
                                 required:true,
                                 zip:true,
                                 onkeyup:false
                          }, contactEmail:{
							    required:true,
                                email:true,
                                onkeyup:false
                          }, street:{
									   required:true,
									minlength:1,
                                maxlength:50,
                                onkeyup:false
						},city:{
									   required:true,   
									 minlength:1,
                                maxlength:50,
                                onkeyup:false
						}, country:{
									  required:true,   
									minlength:1,
                                maxlength:50,
                                onkeyup:false
						}
                    },messages:{
                                  contactName:{ required:"请填写联系人!" ,maxlength:"太长",minlength:"太短"},
								contactEmail:{ required:"请填写邮箱!",email:"邮箱格式错误!" ,maxlength:"太长",minlength:"太短"},
								street:{ required:"请填写街道!",maxlength:"太长",minlength:"太短" },
                                  city:{ required:"请填写城市!",maxlength:"太长",minlength:"太短" },
						   		 country:{ required:"请填写国家!",maxlength:"太长",minlength:"太短" },
                                  contactPhone:{  required:"请填写常用号码!",maxlength:"太长",minlength:"太短" },
                                  postCode:{ required:"请填写邮政编码!", zip:"邮编格式错误!" }
                           },
                             submitHandler: function(form) { 
                        		     form.submit();
                               }
                    }); });	
	</script><!-- validate end  -->
  </head>
  
<body class="bg">

<div id="nav" class="crumbs">
	当前位置：<a href="<%=path %>/servlet/ShowListServlet?key=cusList" class="title">客户管理</a> 修改客户
</div>

<div class="search ctitle">
	<div class="tab">
		<span class="right"></span>
		<span class="font-blue14pxb">修改客户</span>
    </div>
</div>

<div class="tableBox fwidth">
	<form id="upCusForm" method="post" action="<%=path%>/servlet/UpdateServlet?key=doUp" >	
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	  <tr>
		<th class="h" width="30%">公司ID</th>
		<td class="text_left"><label  style="color: #325f86;font-weight: bold;">${cus.customerID }</label>
		<input id="customerID" maxlength="8" name="customerID" type="hidden" value="${cus.customerID }" />
		</td>
		
	  </tr>
	  <tr>
	     <th class="h">公司名称</th>
	     <td class="text_left"><input name="company" maxlength="30" type="text" value="${cus.company }" style="width: 150px;color: #325f86;"/></td>
	  </tr>
	  <tr>
	     <th class="h">联系人</th>
	     <td class="text_left"><input maxlength="20" id="contactName" name="contactName" type="text" value="${cus.contactName }" style="width: 150px;color: #325f86;" islist=true list="1"  autocomplete="off" /> </td>
	  </tr>
	
	  <tr>
		<th class="h">联系电话</th>
		<td class="text_left"><input maxlength="20" name="contactPhone" type="text" value="${cus.contactPhone}" style="width: 150px;color: #325f86;"/></td>
	  </tr>
	 
	  <tr>
		<th class="h">传 真</th>
        <td class="text_left"><input maxlength="30" name="contactFax" type="text" value="${cus.contactFax}" style="width: 150px;color: #325f86;"/></td>
	  </tr>
	
      <tr>
		<th class="h">邮 箱</th>
	  <td class="text_left"><input maxlength="30" name="contactEmail" type="text" value="${cus.contactEmail }" style="width: 150px;color: #325f86;"/></td>
	  </tr>
      <tr>
      
		<th class="h">街 道</th>
	  <td class="text_left"><input name="street" maxlength="30" type="text" value="${cus.street }" style="width: 150px;color: #325f86;"/></td>
	  </tr>
     
      <tr>
		<th class="h">城 市</th>
	  <td class="text_left"><input name="city" maxlength="30" type="text" value="${cus.city }" style="width: 150px;color: #325f86;"/></td>
	  </tr>
	  
      <tr>
		<th class="h">国 家</th>
	  <td class="text_left"><input name="country" type="text" maxlength="30" value="${cus.country }" style="width: 150px;color: #325f86;"/></td>
	  </tr>
	  
      <tr>
		<th class="h">邮 编</th>
	  <td class="text_left"><input name="postCode" type="text" maxlength="6" value="${cus.postCode }" style="width: 150px;color: #325f86;"/></td>
	  </tr>
	
	  <tr>
		<td colspan="2" align="center">
			<input type="submit" name="save" value="修 改" class="button" onMouseOver="this.className='button_mouseover'"
 onmouseout="this.className='button'"/>
		</td>
	  </tr>
	</table>
	</form>
   </div>	
</body>
</html>
